Why am I getting ORA-00904: 'SHA': invalid identifier in my Oracle SQL GROUP BY clause